var drawLine=function (id,d) {
    var svg = document.getElementById("highmap");
    var highline = document.createElementNS("http://www.w3.org/2000/svg","path");
    highline.setAttribute("id", "line"+id);
    highline.setAttribute("class", "high-line high-line"+id);
    highline.setAttribute("fill", "transparent");
    highline.setAttribute("d", d);
    highline.addEventListener("click", function () { });
    highline.addEventListener("webkitAnimationEnd", function () { });
    highline.addEventListener("animationEnd", function () {  });
    svg.appendChild(highline)
}
var func=function(e){
    console.log(e.clientX,e.clientY)
}
$(document).ready(function(){
    var highData={
        line:[
            {
                "lng":"111.614879",
                "lat":"24.430775",
                "id":"1",
                "pointNo":"1"
            },{
                "lng":"111.725263",
                "lat":"24.468670",
                "id":"2",
                "pointNo":"2"
            },{
                "lng":"111.796553",
                "lat":"24.514970",
                "id":"3",
                "pointNo":"3"
            },{
                "lng":"111.860943",
                "lat":"24.607518",
                "id":"4",
                "pointNo":"4"
            },{
                "lng":"111.960404",
                "lat":"24.662568",
                "id":"5",
                "pointNo":"5"
            }
        ]
    }
    var data=[
        {"id":"line3","type":"open","d":"M935,488,L935,488,953,481,Q970,486,986,477"},
        {"id":"line4","type":"open","d":"M165,260,C177,285,200,322,260,346,L260,346,316,389"},
        {"id":"line5","type":"open","d":"M366,153,L366,153,416,236,C436,272,468,284,477,290"},
        {"id":"line6","type":"open","d":"M477,290,Q488,302,502,296,Q515,292,542,300,Q571,308,600,308"},
        {"id":"line7","type":"open","d":"M414,623,L414,623,439,640,L439,640,570,690,Q580,692,590,694"},
        {"id":"line8","type":"open","d":"M745,765,Q782,716,788,677,L788,677,806,622,Q828,607,822,587,Q829,580,838,567"},
        {"id":"line9","type":"open","d":"M646,542,C656,563,652,585,649,605,L649,605,646,688,Q622,722,628,756"},
        {"id":"line10","type":"open","d":"M477,293,C481,343,511,377,532,424"},
        {"id":"line11","type":"open","d":"M534,578,Q550,585,567,577,Q592,567,594,557,Q602,539,583,531,Q559,531,529,538,Q519,538,509,540,Q505,543,506,550,Q512,562,534,578"},
        {"id":"line12","type":"open","d":"M316,389,C330,401,344,436,314,477,L294,497,258,525"},
        {"id":"line13","type":"open","d":"M177,468,C205,496,232,518,258,525"},
        {"id":"line14","type":"open","d":"M688,419,Q715,419,737,431,L737,431,759,442"},
        {"id":"line15","type":"open","d":"M892,80,Q902,108,953,107"},
        {"id":"line16","type":"open","d":"M536,454,Q536,454,562,450,S593,441,619,427,L619,427,648,422,Q688,419,688,419"},
        {"id":"line17","type":"open","d":"M436,471,L436,471,477,451,Q477,451,536,454"},
        {"id":"line18","type":"open","d":"M701,340,Q710,349,729,355,Q744,365,751,382,Q756,414,760,442,Q762,446,770,456"},
        {"id":"line19","type":"open","d":"M258,525,L286,535,306,548,C362,583,401,620,414,623"},
        {"id":"line20","type":"open","d":"M947,535,Q938,526,943,505,L943,505,935,488"},
        {"id":"line21","type":"open","d":"M731,95,L731,95,704,168,L704,168,693,215,Q670,234,684,256,L684,256,687,302,Q688,321,701,340"},
        {"id":"line22","type":"open","d":"M710,326,L710,326,799,382,C804,391,814,403,831,412,Q857,419,892,420,Q916,426,922,439,Q945,456,962,450"},
        {"id":"line23","type":"open","d":"M975,460,Q992,445,987,432,Q974,416,963,446"},
        {"id":"line24","type":"open","d":"M320,390,Q350,375,360,356,Q380,340,402,344,C410,331,416,314,427,304,C444,293,463,288,478,292"},
        {"id":"line25","type":"open","d":"M217,548,Q246,544,260,524"},
        {"id":"line26","type":"open","d":"M593,552,L593,552,646,542,Q664,472,689,419,Q714,369,712,328"},
        {"id":"line27","type":"open","d":"M330,203,Q322,214,329,225,C343,245,323,268,323,275,S320,281,326,291,Q336,304,328,319,Q326,331,332,344,Q323,352,324,364,C316,374,305,383,308,399"},
        {"id":"line28","type":"open","d":"M295,612,Q353,640,414,650"},
        {"id":"line29","type":"open","d":"M813,591,Q793,560,840,472,Q846,459,840,428,Q848,388,855,367,Q866,352,870,317,Q876,292,848,266"},
        {"id":"line30","type":"open","d":"M776,746,L776,748,776,716"},
        {"id":"line31","type":"open","d":"M584,532,Q587,503,602,484,Q638,468,646,445,Q651,392,661,369,Q671,341,686,302"},
        {"id":"line32","type":"open","d":"M712,328,Q728,291,746,274,Q765,250,792,222"},
        {"id":"line33","type":"open","d":"M792,222,Q794,198,824,184"},
        {"id":"line34","type":"open","d":"M532,576,Q552,576,540,568"},
        {"id":"line35","type":"open","d":"M746,274,Q828,282,869,256"},
        {"id":"line36","type":"open","d":"M345,703,Q362,684,386,665,L386,665,456,633,Q490,617,499,593,Q506,585,515,580"},
        {"id":"line37","type":"open","d":"M824,184,Q842,171,843,148"},
        {"id":"line38","type":"open","d":"M958,373,Q955,344,950,314"},
        {"id":"line39","type":"open","d":"M899,278,Q936,292,951,314,L951,314,987,314,Q1005,314,1021,324"},
        {"id":"line40","type":"open","d":"M238,407,Q263,399,291,401,Q299,396,309,398"},
        {"id":"line41","type":"open","d":"M309,398,Q313,396,333,404,L333,404,437,471,Q443,475,453,487,L453,487,492,533"},
        {"id":"line42","type":"open","d":"M927,48,Q938,40,955,36"},
        {"id":"line43","type":"open","d":"M600,308,Q648,306,686,302"},
        {"id":"line44","type":"open","d":"M532,424,L532,424,524,482,Q520,503,536,519,Q539,525,544,536"},
        {"id":"line45","type":"open","d":"M686,302,Q708,297,728,300"},
        {"id":"line46","type":"open","d":"M492,533,L492,533,505,549"},
        {"id":"line47","type":"open","d":"M330,203,Q369,234,410,222"}
    ]
    for (var i = 0; i < data.length; i++) {
        drawLine(data[i].id,data[i].d)
    }
});